package cn.javaweb.library;

import cn.javaweb.entity.User;
import cn.javaweb.model.UserModel;

import java.util.UUID;

public class Token {
    public static String generateToken(){
        return UUID.randomUUID().toString();
    }

    public static User checkToken(String token) {

        UserModel userModel = new UserModel();

        User u = userModel.getUserByToken(token);

        return u;

    }
}
